# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Run.V2.Model.GoogleCloudRunV2BuildpacksBuild do
  @moduledoc """
  Build the source using Buildpacks.

  ## Attributes

  *   `baseImage` (*type:* `String.t`, *default:* `nil`) - Optional. The base image used to opt into automatic base image updates.
  *   `cacheImageUri` (*type:* `String.t`, *default:* `nil`) - Optional. cache_image_uri is the GCR/AR URL where the cache image will be stored. cache_image_uri is optional and omitting it will disable caching. This URL must be stable across builds. It is used to derive a build-specific temporary URL by substituting the tag with the build ID. The build will clean up the temporary image on a best-effort basis.
  *   `enableAutomaticUpdates` (*type:* `boolean()`, *default:* `nil`) - Optional. Whether or not the application container will be enrolled in automatic base image updates. When true, the application will be built on a scratch base image, so the base layers can be appended at run time.
  *   `environmentVariables` (*type:* `map()`, *default:* `nil`) - Optional. User-provided build-time environment variables.
  *   `functionTarget` (*type:* `String.t`, *default:* `nil`) - Optional. Name of the function target if the source is a function source. Required for function builds.
  *   `runtime` (*type:* `String.t`, *default:* `nil`) - The runtime name, e.g. 'go113'. Leave blank for generic builds.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :baseImage => String.t() | nil,
          :cacheImageUri => String.t() | nil,
          :enableAutomaticUpdates => boolean() | nil,
          :environmentVariables => map() | nil,
          :functionTarget => String.t() | nil,
          :runtime => String.t() | nil
        }

  field(:baseImage)
  field(:cacheImageUri)
  field(:enableAutomaticUpdates)
  field(:environmentVariables, type: :map)
  field(:functionTarget)
  field(:runtime)
end

defimpl Poison.Decoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2BuildpacksBuild do
  def decode(value, options) do
    GoogleApi.Run.V2.Model.GoogleCloudRunV2BuildpacksBuild.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Run.V2.Model.GoogleCloudRunV2BuildpacksBuild do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
